<template>
	<view class="">
		<view class="">
			<!-- 2.0.19支持autoBack，默认为false -->
			<u-navbar leftText="预约详情" autoBack>
			</u-navbar>
		</view>


		<view class="con-body">
			<view class="main-service uni-cell-90" style="padding-bottom: 10rpx; width: 96%; margin-left: 2%;">
				<view class="user-list">
					<view style="padding: 5rpx 20rpx">
						<view class="d_view">
							<text class="l_title">已选场地</text>
							<text class="d_content">{{item.tools}}</text>
						</view>
						<u-line></u-line>
						<view class="d_view">
							<text class="l_title">预约时间</text>
							<text class="d_content">{{item.time}}</text>
						</view>
					</view>
				</view>
			</view>
			
			<view class="main-service uni-cell-90" style="padding-bottom: 10rpx; width: 96%; margin-left: 2%;">
				<view class="user-list">
					<view style="padding: 5rpx 20rpx">
						<u-form-item label="联系人" prop="item.name" labelWidth="70" borderBottom>
							<u-input v-model="item.name" placeholder="请填写联系人" border="none"
								style="background-color: #FFFFFF;"></u-input>
						</u-form-item>
						
						<u-form-item label="联系电话" prop="item.tel" labelWidth="70" borderBottom>
							<u-input v-model="item.tel" placeholder="请填写联系电话" border="none"
								style="background-color: #FFFFFF;"></u-input>
						</u-form-item>
					</view>
				</view>
			</view>
			<u-toast ref="uToast" :loading="true"></u-toast>
			
			<u-button :customStyle="btnStyle" @click="confirmRes">确认提交</u-button>
		</view>
	</view>
</template>

<script>
	import { kitchenToolBorrow } from "@/service/shareService.js";
	export default {
		data() {
			return {
				btnStyle: {
					width: '96%',
					borderRadius: '40rpx',
					marginLeft: '2%',
					backgroundImage: "url('https://resourse.cnlhjt.com/upload/20220825/d1aa35c1d129137d9b12c8f34e59c5bc.png')",
					backgroundSize: '100% 80rpx',
					color: '#FFFFFF',
					position: 'fixed',
					bottom: '40rpx'
				},
				item: {}
			}
		},
		onLoad(options) {
			this.item = JSON.parse(options.item);
		},
		methods:{
			confirmRes() {
				let par = this.item;
				kitchenToolBorrow(par).then(res => {
					if (res.code == 200) {
						this.$refs.uToast.show({
				
							type: 'success',
							message: res.msg,
							complete() {
								uni.navigateBack({
									delta: 2
								})
							}
						})
					} else {
						this.$refs.uToast.show({
				
							type: 'error',
							message: res.msg
						})
					}
				})
			}
		}
	}
</script>

<style lang="scss">
	.l_title {
		font-size: 32rpx;
		color: #999999;
		float: left;
	}

	.d_content {
		color: #666666;
		font-size: 32rpx;
	}

	.d_view {
		margin: 20rpx;
		text-align: right;
	}
</style>
